import type { ItemSaleClass } from '@/types/itemSaleClass'
import { http } from '@/utils/http'

/**
 * 分页商品分类列表
 */
export const listItemSaleClass = (data?: ItemSaleClassParams) => {
  return http<ItemSaleClass[]>({
    method: 'GET',
    url: '/api/itemSaleClass/listItemSaleClass',
    data,
  })
}

/**
 * 商品分类详情
 * @param itemSaleClasId 商品分类id
 * @param sysBranchId 门店id
 */
export const selectItemSaleClassById = (itemSaleClassId: number, sysBranchId: number) => {
  return http<ItemSaleClass>({
    method: 'GET',
    url: '/api/itemSaleClass/selectItemSaleClassById',
    data: { itemSaleClassId, sysBranchId },
  })
}

type ItemSaleClassParams = { showIndex?: boolean; parentId?: number }
